/**
 * @file user_data.h
 * @brief
 * @author  xiaowine (xiaowine@sina.cn)
 * @version 01.00
 * @date    2021-04-08
 *
 * @copyright Copyright (c) {2020}  xiaowine
 *
 * @par 修改日志:
 * <table>
 * <tr><th>Date       <th>Version <th>Author  <th>Description
 * <tr><td>2021-04-08 <td>1.0     <td>wangh     <td>内容
 * </table>
 * ******************************************************************
 * *                   .::::
 * *                 .::::::::
 * *                ::::::::::
 * *             ..:::::::::::
 * *          '::::::::::::
 * *            .:::::::::
 * *       '::::::::::::::..        女神助攻,流量冲天
 * *            ..::::::::::::.     永不宕机,代码无bug
 * *          ``:::::::::::::::
 * *           ::::``:::::::::'        .:::
 * *          ::::'   ':::::'       .::::::::
 * *        .::::'      ::::     .:::::::'::::
 * *       .:::'       :::::  .:::::::::' ':::::
 * *      .::'        :::::.:::::::::'      ':::::
 * *     .::'         ::::::::::::::'         ``::::
 * * ...:::           ::::::::::::'              ``::
 * *```` ':.          ':::::::::'                  ::::.
 * *                   '.:::::'                    ':'````.
 * ******************************************************************
 */
#ifndef _USER_DATA_H_
#define _USER_DATA_H_

/* Private includes ----------------------------------------------------------*/
#include "user_type.h"
/* Private typedef -----------------------------------------------------------*/

/* Private define ------------------------------------------------------------*/
#define VERSION "V01.02"
/* Private macro -------------------------------------------------------------*/

/* Private variables ---------------------------------------------------------*/
extern _TKS_FLAGA_type TKS_FLAGA;
#define TKS_63MSF  TKS_FLAGA.bits.b4
#define TKS_250MSF TKS_FLAGA.bits.b5
#define TKS_500MSF TKS_FLAGA.bits.b6

extern volatile _TKS_FLAGA_type BLEbitFlag;
#define BLEInit     BLEbitFlag.bits.b0
#define uartRecOK   BLEbitFlag.bits.b1
#define uartGetflag BLEbitFlag.bits.b2
#define commandMode BLEbitFlag.bits.b3
#define commandOK   BLEbitFlag.bits.b4
#define timeToTrans BLEbitFlag.bits.b5
#define regDataOk   BLEbitFlag.bits.b6
// #define rgbNeedRefresh BLEbitFlag.bits.b7

extern volatile _TKS_FLAGA_type bitFlag;
#define beepFlag        bitFlag.bits.b0
#define flashFlag_0_5HZ bitFlag.bits.b1
#define flashFlag_1HZ   bitFlag.bits.b2
#define flashFlag_2HZ   bitFlag.bits.b3
#define FLAG_63MSF      bitFlag.bits.b4
#define FLAG_250MSF     bitFlag.bits.b5
#define FLAG_500MSF     bitFlag.bits.b6

extern volatile _TKS_FLAGA_type I2CbitFlag;
#define I2CInOkFlag  I2CbitFlag.bits.b0
#define I2COutOkFlag I2CbitFlag.bits.b1
#define bleDataReday I2CbitFlag.bits.b2
#define SEGMENT_TDS0 I2CbitFlag.bits.b3
#define SEGMENT_TDS1 I2CbitFlag.bits.b4

extern volatile unsigned char I2cDataIn[30];
extern volatile unsigned char I2cDataOut[30];

extern volatile _TKS_FLAGA_type I2CboardFlag;
#define boardBLEFlag  I2CboardFlag.bits.b0
#define boardPARAFlag I2CboardFlag.bits.b1
#define bleInitFlag   I2CboardFlag.bits.b2

extern uint32_t ledValue;

extern const unsigned char protocolHeader[2];

extern uint8_t segmentValue[13];
/* Private function prototypes -----------------------------------------------*/

extern _BEEP_STATE beepState;
#define BEEPMODE  beepState.bits.mode
#define BEEPLONG  beepState.bits.bits3
#define BEEPSHORT beepState.bits.bits4

/* Private user code ---------------------------------------------------------*/

#endif
